var ctx=window.daijia.ctx;

$(function () {

	//提交表单
    $("#submit_form").submit(function(){
		
		var phone=$("#phone").val();
		var isphone=/^\+?\d{3,13}(\-?(\d{6,8}?))?(\-?(\d{4,8}?))*$/; 
		if (!isphone.test(phone)){
			$.scojs_message("电话格式不正确", $.scojs_message.TYPE_ERROR);
			return false;
		}
    	
		$("#submit_button").attr("disabled",true);
		$.post($("#submit_form").attr("action"),$("#submit_form").serialize(),function(result){
			if(result.success){
				$.scojs_message("审核成功", $.scojs_message.TYPE_OK);
				window.location=ctx+'/memberapply/list';
			}
			else{
				$.scojs_message(result.message, $.scojs_message.TYPE_ERROR);
				$("#submit_button").attr("disabled",false);
			}
		});
		
		return false;
    }); 
    
});

